/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Dell
 */
// ines ines
@Entity
@Table(name = "trace")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Trace.findAll", query = "SELECT t FROM Trace t"),
    @NamedQuery(name = "Trace.findByIdtrace", query = "SELECT t FROM Trace t WHERE t.idtrace = :idtrace"),
    @NamedQuery(name = "Trace.findByDatec", query = "SELECT t FROM Trace t WHERE t.datec = :datec")})
public class Trace implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idtrace")
    private Integer idtrace;
    @Basic(optional = false)
    @NotNull
    @Column(name = "datec")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datec;
    @JoinColumn(name = "idm", referencedColumnName = "idm")
    @ManyToOne(optional = false)
    private Modelerdp idm;
    @JoinColumn(name = "login", referencedColumnName = "login")
    @ManyToOne(optional = false)
    private Utilisateur login;
    @JoinColumn(name = "refmarquage", referencedColumnName = "refmarquage")
    @ManyToOne(optional = false)
    private Marquage refmarquage;

    public Trace() {
    }

    public Trace(Integer idtrace) {
        this.idtrace = idtrace;
    }

    public Trace(Integer idtrace, Date datec) {
        this.idtrace = idtrace;
        this.datec = datec;
    }

    public Integer getIdtrace() {
        return idtrace;
    }

    public void setIdtrace(Integer idtrace) {
        this.idtrace = idtrace;
    }

    public Date getDatec() {
        return datec;
    }

    public void setDatec(Date datec) {
        this.datec = datec;
    }

    public Modelerdp getIdm() {
        return idm;
    }

    public void setIdm(Modelerdp idm) {
        this.idm = idm;
    }

    public Utilisateur getLogin() {
        return login;
    }

    public void setLogin(Utilisateur login) {
        this.login = login;
    }

    public Marquage getRefmarquage() {
        return refmarquage;
    }

    public void setRefmarquage(Marquage refmarquage) {
        this.refmarquage = refmarquage;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtrace != null ? idtrace.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Trace)) {
            return false;
        }
        Trace other = (Trace) object;
        if ((this.idtrace == null && other.idtrace != null) || (this.idtrace != null && !this.idtrace.equals(other.idtrace))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Trace[ idtrace=" + idtrace + " ]";
    }
    
}
